package com.bluestone.scripts;

import java.util.HashMap;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "action", propOrder = {
	"parent",	
	"paras"	
})
public class ActionScript {
	
	@XmlAttribute
	protected String type = null;
				
	@XmlElement(name = "parent")
	protected Object parent;
	
	
	@XmlAttribute
	protected String name =""+System.currentTimeMillis();
				
	@XmlJavaTypeAdapter(KeyValueMapAdapter.class)
	protected HashMap<String, String> paras;

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public Object getParent() {
		return parent;
	}

	public void setParent(Object parent) {
		this.parent = parent;
	}


	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	public HashMap<String, String> getParas() {
		return paras;
	}
	
	public String getPara(String key){
		return paras.get(key);
	}
	
	public String setPara(String key,String value){
		return paras.put(key, value);
	}	

	public void setParas(HashMap<String, String> paras) {
		this.paras = paras;
	}
}
